#define  _CRT_SECURE_NO_WARNINGS
class Solution {
    vector<vector<int>> ret;
    vector<int> path;
public:
    vector<vector<int>> subsets(vector<int>& nums) {
        dfs1(nums);
        return ret;
    }
    void dfs2(vector<int>& nums, int cut = -1)
    {
        ret.push_back(path);
        for (int i = cut + 1; i < nums.size(); i++)
        {
            path.push_back(nums[i]);
            dfs2(nums, i);
            path.pop_back();
        }
    }
    void dfs1(vector<int>& nums, int index = 0)
    {
        if (index == nums.size())
        {
            ret.push_back(path);
            return;
        }
        dfs1(nums, index + 1);
        path.push_back(nums[index]);
        dfs1(nums, index + 1);
        path.pop_back();
    }
};